//
//  MZApiManager.swift
//  MZTool
//
//  Created by gby on 2023/2/7.
//

import Foundation
import Alamofire


extension MZApiRequest {
    
    //    fileprivate func request_AF(_ res: @escaping MZRequestSucceedClosure, _ failure: @escaping MZRequestFailureClosure) throws -> MZCancellable{
    //        return self.request_Normal(request: self, res, failure)
    //    }
    
}







public struct MZAF{
    
    public static func mainAsync(_ done: @escaping (() -> Void)) {
        if Thread.current.isMainThread {
            done()
        }else{
            let semaphore = DispatchSemaphore(value: 0)
            DispatchQueue.main.async {
                done()
                semaphore.signal()
            }
            semaphore.wait()
        }
    }
    
}




